#include "xueyangxueya.h"
#include "usart.h"
#include "delay.h"
#include "healthmod.h"
 xueyadata xueyadata1;

void XueyangxueyaInit(void)
{
    	uart2_init(38400);//血氧
		uart3_init(115200);//血压
}

u8 xueyacmd[6] = {0xFD, 0x00, 0x00, 0x00, 0x00,0x00}; // 血压启动指令

u8 delaycount=0;
    // 舒张，收缩，心率
    void XueyaGet(void)
{
    USARTx_Send(USART3, xueyacmd, 6);//启动血压检测
  delaycount=0;
    while((USART3_RX_STA&0x8000) != 0x8000)
    {
//    delaycount++;
//      delay_ms(100);
//      if(delaycount>10)
//        break;
    }
    USART3_RX_STA=0;
    xueyadata1.shuzhangya=USART3_RX_BUF[0];
    xueyadata1.shousuoya=USART3_RX_BUF[1];
    xueyadata1.xinlv=USART3_RX_BUF[2];
}

